package scuff.msg.json.gson

import scuff.msg.json.JsonMessageWriter
import scuff.msg.util.OutgoingMessage
import com.google.gson.Gson

abstract class ReflectiveGsonWriter[-PL <: AnyRef](gson: Gson = new Gson) extends JsonMessageWriter[PL, Appendable] {
  protected def serialize(msg: OutgoingMessage[PL], sink: Appendable) = gson.toJson(msg, sink)
}